//
//  NSDate+DateString.m
//  RMEducation
//
//  Created by qxb on 16/4/1.
//  Copyright © 2016年 tongbinLi. All rights reserved.
//

#import "NSDate+DateString.h"

#import "NSDate+Utilities.h"

@implementation NSDate (DateString)


+ (NSString *)getDateStringWithData:(NSDate *)date
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSString *dateString = [formatter stringFromDate:date];
    return dateString;
}



- (NSString *)dateWeek {
    if (self) {
        NSInteger week = self.weekday;
        switch (week) {
            case 1:
                return @"星期天";
                break;
            case 2:
                return @"星期一";
                break;
            case 3:
                return @"星期二";
                break;
            case 4:
                return @"星期三";
                break;
            case 5:
                return @"星期四";
                break;
            case 6:
                return @"星期五";
                break;
            case 7:
                return @"星期六";
                break;
            default:
                break;
        }
    }
    return nil;
}

@end
